<include file="Public/ace_header" />
<style type="text/css">
.find-input-div {
    margin-bottom: 10px;
}

th {
    width: 40px;
}

td {
    width: 40px;
}
</style>
<div class="row">
    <div class="col-xs-12">
        <div class="row hidden-480 find" style="margin-left: 100px">
            <!-- 查询块 -->
            <form id="find-form">
                  <div class="col-md-2 find-input-div">
                    <input type="text" class="col-md-12 find-input" name="term_name" id="term_name" value="{$_GET[term_name]}" placeholder="学期及交费项">
                </div>
                <div class="col-md-3 find-input-div">
                    <span class="block input-icon input-icon-right">
                        <select name="class_id" id="class_id" class="width-100">
                            <option value="">所在班级</option>
                            <volist name="class" id="vo">
                            <php>$class=D('class')->find($vo['id'])</php>
                            <option value="{$vo['id']}" <if condition ="$_GET
                            ['class_id'] eq $vo['id']"> selected </if>>{:D('Grade')->where(['id'=>$class['grade_id']])->find()['name']}{:D('Major')->where(['id'=>$class['major_id']])->find()['name']}{$vo['name']}</option>
                            </volist>
                    
                        </select>
                        <i class=""></i>
                    </span>
                </div>
                <div class="col-md-2 find-input-div">
                    <input type="text" class="col-md-12 find-input" name="update_timeStart" id="update_timeStart" value="{$_GET[update_timeStart]}" placeholder="开始时间" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" readonly="" onChange="update_timeStartChange()" />
                </div>
                <div class="col-md-2 find-input-div">
                    <input type="text" class="col-md-12 find-input" name="update_timeEnd" id="update_timeEnd" value="{$_GET[update_timeEnd]}" placeholder="结束时间" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" readonly="" onChange="update_timeEndChange()" />
                    <!--   <button type="submit" class="btn btn-success btn-xs" style="width:100px;height:40px;float:right;margin-right:2rem;margin-top:1rem;">查询</button> -->
                </div>
                <div class="col-md-2 find-input-div">
                    <button type="submit" class="btn btn-success btn-xs">查询</button>
                </div>
                <script>
                function update_timeStartChange() {
                    var update_timeEnd = $("#update_timeEnd").val();
                    if (update_timeEnd != "") {
                        var update_timeStart = $("#update_timeStart").val();
                        if (update_timeEnd < update_timeStart) {
                            alert("起始时间必须早于结束时间!");
                            $("#update_timeStart").val("");
                        }
                    }

                }

                function update_timeEndChange() {
                    var update_timeStart = $("#update_timeStart").val();
                    if (update_timeStart != "") {
                        var update_timeEnd = $("#update_timeEnd").val();
                        if (update_timeStart > update_timeEnd) {
                            alert("结束时间必须晚于起始时间!");
                            $("#update_timeEnd").val("");
                        }
                    }
                }
                </script>
        </div>
        </form>
    </div>
    <div class="table-responsive">
        <table id="sample-table-1" class="table table-striped table-bordered table-hover" style="width:60%;margin-left: 200px">
            <tr>
                <td>总人数</td>
                <td>{$student}</td>
            </tr>
            <tr>
                <td>已交费人数</td>
                <td>{$newModel}</td>
            </tr>
            <tr>
                <td>已交清人数</td>
                <td>{$num}</td>
            </tr>
            <tr>
                <td>应交总金额</td>
                <td>{$shouldSum}</td>
            </tr>
            <tr>
                <td>已交总金额(已减去退款金额)</td>
                <td>{$overSum}</td>
            </tr>
            <tr>
                <td>已退金额</td>
                <td>{$quitSum}</td>
            </tr>
            <tr>
                <td>总欠款金额</td>
                <td>{$shouldSum-$overSum}</td>
            </tr>
        </table>
    </div>
    <!-- /.table-responsive -->
</div>
<!-- /span -->
</div>
<!-- /row -->
<include file="Public/ace_footer" />
